<template>
	<div class="auth-input-group">
		<i v-if="icon" :class="'icon iconfont '+icon"></i>
		<el-input :type="type" :value="value" @change="updateValue" :placeholder="placeholder" @focus="onFocus" @blur="onBlur"></el-input>
	</div>
</template>

<script>
export default {
	props: {
		value: null,
		icon: {
			type: String,
			default: ''
		},
		placeholder: String,
		disabled: {
			type: Boolean,
			default: false
		},
		type: {
			type: String,
			default: 'text'
		},
		focus: Function,
		blur: Function
	},
	methods: {
		onFocus (e) {
			this.$emit('focus', e);
		},
		onBlur (e) {
			this.$emit('blur', e);
		},
		updateValue (value) {
			this.$emit('input', value);
		}
	}
}
</script>

<style>
	.auth-input-group {
		display: inline-block;
		opacity: 0.8;
		width: 100%;
	}

	.auth-input-group .icon {
		position: absolute;
		line-height: 57px;
		height: 57px;
		margin-left: 19px;
		font-size: 20px;
		z-index: 1;
	}

	.auth-input-group input {
		padding: 20px 0px 20px 50px;
	    width: 100%;
	    font-size: 18px;
	    height: 57px;
	    box-sizing: border-box;
		border-radius: 0px;
	}
</style>
